package com.gs.cd.service.auth.eum;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

public enum StoreTypeEnum {

    NEO4J("neo4j"), PG("postgreSQL");

    @EnumValue
    private final String name;


    StoreTypeEnum(String name) {
        this.name = name;
    }

    @JsonValue
    public String getName() {
        return name;
    }

    @JsonCreator
    public static StoreTypeEnum fromName(String name) {

        for (StoreTypeEnum value : StoreTypeEnum.values()) {
            if (value.getName().equals(name)) return value;
        }

        return null;
    }
}
